<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="../org/angular.min.js"></script>
</head>
<body ng-app="hd">
<div ng-controller="ctrl">

{{data}}
</div>
<script>
    var m = angular.module('hd', []);
    m.controller('ctrl', ['$scope', function ($scope) {
        /*对象扩展*/
        var obj = {name: '后盾网'};
        angular.extend(obj, {url:'houdunwang.com', 'web':'aaaaaa'});
        console.log(obj);

        /*遍历数组*/
        $scope.data = [{name:'后盾网', url:'houdunwang.com'}, {name:'后盾人', url:'houdunren.com'}];
        angular.forEach($scope.data, function (v, k) {
            console.log(k);
            v.url = 'www.' + v.url;
        });
    }]);

</script>
</body>
</html>